//#ifndef __TENACITAS__PERIODICITY__DATE_H__
//#define __TENACITAS__PERIODICITY__DATE_H__

//// =============================================================================
///**
//   @file
//   File description
//*/


//// =============================================================================
////                                 C++ Headers

//#include <time.h>
//#include <sys/time.h>
//#include <sstream>
//#include <iomanip>
//#include <iostream>
//#include <list>
//#include <cstdint>

//// =============================================================================
////                                 3rds Headers


//// =============================================================================
////                                 Our Headers


//// =============================================================================
////                                 Namespaces
//using namespace std;


//// =============================================================================
////                                 Macro Contants

///**
// */


//// =============================================================================
////                                 Macro Commands

///**
// */


///** namespace of the organization */
//namespace tenacitas {

///** namespace for the project */
//namespace periodicity {

//// =========================== Typedefs ===========================
///** */


//// ============================ Pre-Declarations ==================
//class date;

//// ============================ Attributes ========================
///** */


//// ============================ Functions =========================
///** */


//// ============================ Classes ===========================
///**

//            @nosubgrouping
//        */
//class day {

//    // --- day - Friends --------------------------------------

//    /** output to ostream */
//    friend std::ostream &operator << (std::ostream &o,
//                                      const day &d) {

//        std::ostringstream s;
//        s << d;
//        o << s.str();
//        return o;
//    }

//    /** output to ostringstream */
//    friend std::ostringstream &operator << (std::ostringstream &o,
//                                            const day &d) {
//        o << setw(2) << setfill('0')
//          <<
//             static_cast<basic::u16t>(d.get_value()) ;
//        return o;
//    }

//    friend class date;

//public:

//    // --- day - Public Internal Types ------------------------

//    /** The type of the value of the day */
//    typedef uint8_t value_type;

//    // --- day - Public Constructors --------------------------

//    /** Creates a tenacitas::day object
//                    *
//                    * @param [in] value is the value of the day, defaulting
//                    * to 1
//                    */
//    day ( const value_type &value = 1 ) ;

//    /** Copy constructor */
//    day ( const day &d );

//    /** Destructor */
//    ~day();

//    // --- day - Public Accessors -----------------------------

//    /** Retrieves the value of the day */
//    const value_type &get_value() const;

//    // --- day - Public Operators -----------------------------

//    /** Equal-to operator */
//    bool operator == (const day &d) const;

//    /** Not-equal-to operator */
//    bool operator != (const day &d) const;

//    /** Greather-than  operator */
//    bool operator > (const day &d) const;

//    /** Greather-than-or-equal-to  operator */
//    bool operator >= (const day &d) const;

//    /** Less-than  operator */
//    bool operator < (const day &d) const;

//    /** Less-than-or-equal-to  operator */
//    bool operator <= (const day &v) const;

//    /** Assigment operator */
//    day &operator = (const day &d);

//    // --- day - Public Attributes ----------------------------

//    /** Indicates that one tried to create a day
//                 * greater than 31
//                 */
//    static const basic::fault::code error_day_greater_31;

//    /** Indicates that one tried to create a day
//                 * greater equal to 0
//                 */
//    static const basic::fault::code error_day_equals_0;

//private:

//    // --- day - Private Attributes ---------------------------

//    /** The value of the day */
//    value_type m_value;
//};

//}
//}

//// =============================================================================
////                     I M P L E M E N T A T I O N
//// =============================================================================

//using namespace tenacitas::periodicity;





/////** @brief A sequence of @p tenacitas::day objects */
////typedef list<day> days;


/////** Represents a month in a date */
////class month {

////    //                 month  FRIENDS

////    //                                    classes

////    friend class date;

////    //                                    methods

////    //                                    operators

////    /** output to ostream */
////    friend std::ostream &operator << (std::ostream &o,
////                                      const month &d) {

////        std::ostringstream s;
////        s << d;
////        o << s.str();
////        return o;
////    }

////    /** output to ostringstream */
////    friend std::ostringstream &operator << (std::ostringstream &o,
////                                            const month &d) {
////        o << setw(2) << setfill('0') << static_cast<basic::u16t>(d.get_value()) ;
////        return o;
////    }


////public:

////    //                 month PUBLIC internal classes


////    /** The type of the value of the month */
////    typedef basic::u8t value_type;

////    //                 month PUBLIC   constructors

////    /**
//// Creates a @p month object
////   *
////         * @param [in] value is the value of the @p month,
////         * default to 10 (october)
////         */
////    month (const value_type &value = 10) throw ( basic::fault );

////    /** Copy constructor */
////    month (const month &m);

////    /** Destructor */
////    ~month();

////    //                 month PUBLIC   gets

////    /** Retrieves the value of the month */
////    const value_type &get_value() const;

////    //                 month PUBLIC   sets

////    //                 month PUBLIC   helpers

////    //                 month PUBLIC   processors

////    /** Equal-to operator */
////    bool operator == (const month &m) const;

////    /** Not-equal-to operator */
////    bool operator != (const month &m) const;

////    /** Greather-than  operator */
////    bool operator > (const month &m) const;

////    /** Greather-than-or-equal-to  operator */
////    bool operator >= (const month &m) const;

////    /** Less-than  operator */
////    bool operator < (const month &m) const;

////    /** Less-than-or-equal-to  operator */
////    bool operator <= (const month &m) const;

////    /** Assigment operator  */
////    month &operator = (const month &m);

////    //                 month PUBLIC   operators

////    //                 month PUBLIC   attributes

////    /** The only possible @p month objects  */
////    static const month jan;
////    static const month feb;
////    static const month mar;
////    static const month abr;
////    static const month may;
////    static const month jun;
////    static const month jul;
////    static const month ago;
////    static const month sep;
////    static const month oct;
////    static const month nov;
////    static const month dec;

////    /** Indicates that one tried to create a month
////         * greater than 12
////         */
////    static const basic::fault::code error_month_greater_12;

////    /** Indicates that one tried to create a month
////         * greater equal to 0
////         */
////    static const basic::fault::code error_month_equals_0;

////private:
////    //                 month PRIVATE internal classes

////    //                 month PRIVATE   constructors

////    //                 month PRIVATE   gets

////    //                 month PRIVATE   sets

////    //                 month PRIVATE   helpers

////    //                 month PRIVATE   processors

////    //                 month PRIVATE   operators

////    //                 month PRIVATE   attributes

////    /** The value of the month  */
////    value_type m_value;
////};

/////** A sequence of @p tenacitas::month objects */
////typedef list<month> months;


/////** Represents a year in a date
////     *
////     * @todo detailed documentation for tenacitas::year
////     */

////class year {

////    //           year  FRIENDS

////    //                                    classes

////    friend class date;

////    //                                    methods

////    //                                    operators

////    /** output to ostream */
////    friend std::ostream &operator << (std::ostream &o,
////                                      const year &d) {

////        std::ostringstream s;
////        s << d;
////        o << s.str();
////        return o;
////    }

////    /** output to ostringstream */
////    friend std::ostringstream &operator << (std::ostringstream &o,
////                                            const year &d) {
////        o << d.get_value() ;
////        return o;
////    }

////public:

////    //           year PUBLIC internal classes


////    /** The type of the value of the year */
////    typedef basic::u16t value_type;

////    //           year PUBLIC   constructors

////    /** Creates a @p year object
////         *
////         * @param [in] value is the value of the year, debasic::faulting
////         * to the minimum possible value, which is
////         * tenacitas::year::min_value
////         */
////    year(const value_type &value = year::min_value)
////    throw ( basic::fault );

////    /** Copy constructor  */
////    year (const year &y);

////    /** Destructor  */
////    ~year();


////    //           year PUBLIC   gets

////    /** Retrieves the value of the year  */
////    const value_type &get_value() const;

////    //           year PUBLIC   sets

////    //           year PUBLIC   helpers

////    //           year PUBLIC   processors

////    /** Equal-to operator  */
////    bool operator == (const year &y) const;

////    /** Not-equal-to operator */
////    bool operator != (const year &y) const;

////    /** Greather-than  operator */
////    bool operator > (const year &y) const;

////    /** Greather-than-or-equal-to  operator */
////    bool operator >= (const year &y) const;

////    /** Less-than  operator */
////    bool operator < (const year &y) const;

////    /** Less-than-or-equal-to  operator */
////    bool operator <= (const year &y) const;

////    /** Assigment operator  */
////    year &operator = (const year &y);

////    /** Minus operator */
////    year operator - (const basic::i16t &n) const;

////    /** Plus operator  */
////    year operator + (const basic::i16t &n) const;

////    //           year PUBLIC   operators

////    //           year PUBLIC   attributes

////    /** Indicates that one tried to create a year
////         * before tenacitas::year::min_value
////         */
////    static const basic::fault::code error_year_less_than_min;

////    /** The minimum value for a year  */
////    static const value_type min_value;


////private:


////    //           year PRIVATE   attributes

////    /** The value of the year  */
////    value_type m_value;
////};


/////** A sequence of @p tenacitas::year objects  */
////typedef list<year> years;


/////** Represents a weekday in a date  */
////class weekday {

////    //                 weekday  FRIENDS

////    //                                    classes

////    friend class date;

////    //                                    methods

////    //                                    operators

////    /** output to ostream */
////    friend std::ostream &operator << (std::ostream &o,
////                                      const weekday &d) {

////        std::ostringstream s;
////        s << d;
////        o << s.str();
////        return o;
////    }

////    /** output to ostringstream  */
////    friend std::ostringstream &operator << (std::ostringstream &o,
////                                            const weekday &d) {
////        o << setw(2) << setfill('0') << static_cast<basic::u16t>(d.get_value()) ;
////        return o;
////    }


////public:

////    //                 weekday PUBLIC internal classes

////    /** The type of the value of the weekday  */
////    typedef basic::u8t value_type;

////    //                 weekday PUBLIC   constructors

////    /** Creates a @p weekday object
////         *
////         * @param [in] value is the value of the weekday,
////         * debasic::faulting to 0 (sunday)
////         */
////    weekday (const value_type &value = 0) throw ( basic::fault );

////    /** Copy constructor  */
////    weekday (const weekday &m);

////    /** Destructor  */
////    ~weekday();

////    //                 weekday PUBLIC   gets

////    //                 weekday PUBLIC   sets

////    //                 weekday PUBLIC   helpers

////    //                 weekday PUBLIC   processors

////    /** Equal-to operator  */
////    bool operator == (const weekday &w) const;

////    /** Not-equal-to operator  */
////    bool operator != (const weekday &w) const;

////    /** Greather-than  operator  */
////    bool operator > (const weekday &w) const;

////    /** Greather-than-or-equal-to  operator  */
////    bool operator >= (const weekday &w) const;

////    /** Less-than  operator  */
////    bool operator < (const weekday &w) const;

////    /** Less-than-or-equal-to  operator  */
////    bool operator <= (const weekday &w) const;

////    /** Assigment operator   */
////    weekday &operator = (const weekday &w);

////    //                 weekday PUBLIC   operators

////    //                 weekday PUBLIC   attributes

////    /** The only possible @p weekday objects  */
////    static const weekday sun;
////    static const weekday mon;
////    static const weekday tue;
////    static const weekday wen;
////    static const weekday thu;
////    static const weekday fri;
////    static const weekday sat;


////    /** Indicates that one tried to create a @p weekday
////         * with a value greater than 6
////         */
////    static const basic::fault::code error_weekday_greater_6;


////protected:

////    //                 weekday PROTECTED   gets

////    /** Retrieves the value of the weekday  */
////    const value_type &get_value() const;


////private:


////    //                 weekday PRIVATE   attributes

////    /** The value of the weekday  */
////    value_type m_value;
////};

/////** A sequence of @p tenacitas::weekday objects  */
////typedef list<weekday> weekdays;


/////** Implements a date
////     *
////     * This implementation uses the Gregorian calendar. The implementation
////     * were based on http://alcor.concordia.ca/~gpkatch/gdate-method.html,
////     * http://alcor.concordia.ca/~gpkatch/gdate-algorithm.html and
////     * http://www.bbc.co.uk/dna/h2g2/A22548314
////     *
////     * As much as possible, algorithms on @p date are implemented
////     * as algorithms (functions) dissasociated from the @p date class
////     */

////class date {

////    //                  date  FRIENDS

////    //                                    classes

////    //                                    methods

////    //                                    operators

////    /** output to ostream  */
////    friend std::ostream &operator << (std::ostream &o,
////                                      const date &d) {

////        std::ostringstream s;
////        s << d;
////        o << s.str();
////        return o;
////    }

////    /** output to ostringstream */
////    friend std::ostringstream &operator << (std::ostringstream &o,
////                                            const date &d) {
////        o << d.get_day() << "/";
////        o << d.get_month() << "/";
////        o << d.get_year() ;
////        return o;
////    }

////public:

////    //                  date PUBLIC internal classes

////    typedef basic::umaxt value_type;
////    typedef day day_type;
////    typedef month month_type;
////    typedef year year_type;
////    typedef weekday weekday_type;
////    typedef date date_type;


////    //                  date PUBLIC   constructors

////    /** Constructor  */
////    date();

////    /** Constructor
////         *
////         * @param [in] d is the value of the day of the @p date
////         * object
////         * @param [in] m is the value of the month of the @p date
////         * object
////         * @param [in] y is the value of the year of the @p date object
////         */
////    date (const day &d,
////          const month &m,
////          const year &y) throw ( basic::fault );

////    /** Copy constructor  */
////    date (const date &d);

////    /** Creates a @p date object from a number representing a
////         * date
////         *
////         * @param [in] date_as_number is the value of the numerci
////         * representation of a @p date object
////         */
////    date (const date::value_type &date_as_number)
////    throw (basic::fault) ;

////    /** Destructor  */
////    ~date();

////    //                  date PUBLIC   gets

////    /**  @brief Retrieving the day       */
////    const day &get_day() const;

////    /**  @brief Retrieving the month  */
////    const month &get_month() const;

////    /**  @brief Retrieving the year  */
////    const year &get_year() const;

////    /** Retrieving the weekday  */
////    weekday get_weekday();

////    /** Retrieves the number representation of the date  */
////    const value_type &get_value() const;

////    //                  date PUBLIC   sets

////    /** Defines a new value for the day of a @p date
////         * object
////         *
////         * @param [in] d is the new value for the day
////         *
////         * @throw a basic::fault object if the new date is invalid
////         */
////    void set_day ( const day & d ) throw ( basic::fault ) ;

////    /** Defines a new value for the month of a @p date
////         * object
////         *
////         * @param [in] m is the new value for the month
////         *
////         * @throw a basic::fault object if the new date is invalid
////         */
////    void set_month ( const month & m ) throw (basic::fault) ;

////    /** Defines a new value for the year of a @p date
////         * object
////         *
////         * @param [in] y is the new value for the year
////         *
////         * @throw a basic::fault object if the new date is invalid
////         */
////    void set_year ( const year & y ) throw (basic::fault) ;

////    //                  date PUBLIC   helpers

////    //                  date PUBLIC   processors

////    /** Retrieves a @p date with the date of today */
////    static date today();

////    //                  date PUBLIC   operators

////    /** Equal-to operator  */
////    bool operator == (const date &d) const;

////    /** Not-equal-to operator  */
////    bool operator != (const date &d) const;

////    /** Greather-than  operator */
////    bool operator > (const date &d) const;

////    /** Greather-than-or-equal-to  operator */
////    bool operator >= (const date &d) const;

////    /** Less-than  operator */
////    bool operator < (const date &d) const;

////    /** Less-than-or-equal-to  operator */
////    bool operator <= (const date &d) const;

////    /** assingment operator  */
////    date & operator = (const date &d);


////    //                  date PUBLIC   attributes

////    /**  Date trying to be created is previous to 1582-oct-1  */
////    static const basic::fault::code error_date_previous_to_min_date;

////    /**  Date trying to be created is invalid  */
////    static const basic::fault::code error_invalid_date;

////    /**  An error processing the date occurred  */
////    static const basic::fault::code error_processing_date;

////protected:

////    //                  date PROTECTED   processors

////    /**  Tells if a date is actually valid
////         *
////         * @param [in] d is the value of a possible valid day
////         * @param [in] m is the value of a possible valid month
////         * @param [in] y is the value of a possible valid year
////         * @param [in] v is the value of a possible valid numeric
////         * representation of a @date
////         */
////    static void validate(const day &d,
////                         const month &m,
////                         const year &y,
////                         const date::value_type &v)
////    throw ( basic::fault );


////    /**  Calculates the number associated to a
////         * day-month-year
////         *
////         * @param [in] d is the day of the @p date
////         * @param [in] m is the month of the @p date
////         * @param [in] y is the year of the @p date
////         *
////         * @return a numeric value corresponding to a @p date
////         * object
////         */
////    static value_type
////    to_number(const day &d,
////              const month &m,
////              const year &y);

////    /**  Calculates the day-month-year associated to a
////         * number representing  a date
////         *
////         * @param [in] v is the numeric value corresponding to a
////         * @p date object
////         * @param [out] d is the day of the @p date
////         * @param [out] m is the month of the @p date
////         * @param [out] y is the year of the @p date
////         */
////    static void to_date(const value_type &v,
////                        day &d,
////                        month &m,
////                        year &y);


////    /**  Calculates the weekday  */
////    weekday calculate_weekday();

////    //                  date PROTECTED   operators

////    //                  date PROTECTED   attributes

////    /** The minimum value of the numeric
////         * representation of the a @p date object
////         */
////    static const value_type min_value;


////private:

////    //                  date PRIVATE   attributes

////    /**  We keep the day of the date to speed up the 'get_day()' method  */
////    day m_day;

////    /**  We keep the month of the date to speed up the 'get_month()' method */
////    month m_month;

////    /**  We keep the year of the date to speed up the 'get_year()' method */
////    year m_year;

////    /**  The number representing the date */
////    value_type m_value;

////    /**  We keep the weekday of the date to speed up the 'get_weekday()'
////// 	    method  */
////    // 	    weekday m_weekday;
////};

/////** A sequence of @p tenacitas::date objects */
////typedef list<date> dates;

////}

//#endif
